<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>订单管理</title>
	<%--静态包含base标签，css样式，JQuery文件--%>
	<%@include file="/pages/common/head.jsp"%>
	<script type="text/javascript">
		$(function () {
			$(".senditem").click(function () {
             return confirm("你确定要发货订单号为:"+$(this).parent().parent().find("td:first").text()+"的商品吗？")
			});
		})
	</script>
</head>
<body>
	
	<div id="header">
			<img class="logo_img" alt="" src="../../static/img/logo.gif" >
			<span class="wel_word">订单管理系统</span>
		<%--静态包含manager管理模块的菜单--%>
		<%@include file="/pages/common/manager_menu.jsp"%>
	</div>
	
	<div id="main">
		<table>
			<tr>
				<td>订单号</td>
				<td>日期</td>
				<td>金额</td>
				<td>状态</td>
				<td>详情</td>
				<td>发货</td>
				
			</tr>
			<c:forEach items="${requestScope.orders}" var="order">
				<%
					System.out.println("进入");
				%>
				<tr>
					<td>${order.orderId}</td>
					<td><fmt:formatDate value="${order.createTime}" pattern="yyyy.MM.dd"/></td>
					<td>${order.price}</td>
					<td>
						<c:if test="${order.status eq 0}">未发货</c:if>
						<c:if test="${order.status eq 1}">已发货</c:if>
						<c:if test="${order.status eq 2}">已签收</c:if>
					</td>
					<td><a href="orderServlet?action=showOrderDetails&orderId=${order.orderId}">查看详情</a></td>
					<td>
						<c:if test="${order.status eq 0}">
						<a class="senditem"  href="orderServlet?action=sendOrder&orderId=${order.orderId}">点击发货</a>
						</c:if>
						<c:if test="${order.status ==1}">
						<a style="color:gray">点击发货</a>
						</c:if>

					</td>
				</tr>
			</c:forEach>

		</table>
	</div>

	<%--静态包含页脚内容--%>
	<%@include file="/pages/common/footer.jsp"%>
</body>
</html>